package biz.datalk.industrialland.common.exception;

import biz.datalk.industrialland.common.result.UnifyResultCode;
import org.apache.shiro.authc.AuthenticationException;

/**
 * 自定义 token 异常
 *
 * @author tarofang@163.com
 * @date 2020-01-13
 *
 */
public class DatalkTokenException extends AuthenticationException {
    private static final long serialVersionUID = -1790949084177459178L;

    public static final String MESSAGE = "登录超时，请重新登录。";
    protected String code = UnifyResultCode.TOKEN_TIMEOUT;

    public DatalkTokenException() {
        super(MESSAGE);
    }

    public DatalkTokenException(String message) {
        super(message);
    }

    public DatalkTokenException(String code, String message) {
        super(message);
        this.code = code;
    }

    public DatalkTokenException(String message, Throwable cause) {
        super(message, cause);
    }

    public DatalkTokenException(String code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public DatalkTokenException(Throwable cause) {
        super(cause);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
